import { Body, Controller, Param, Post } from '@nestjs/common';
import { FileService } from './file.service';
import { Result } from '../../common/result/Result';

@Controller('/api/v1/files')
export class FileController {
  constructor(private fileService: FileService) {}

  @Post('/import/:table')
  async importTable(@Param('table') table: string, @Body() body: any[]) {
    await this.fileService.importTable(table, body);
    return Result.success();
  }
}
